//
//  UserManager.h
//  MiBaoTu
//
//  Created by admin on 16/9/26.
//  Copyright © 2016年 com.caesartech15. All rights reserved.
//  全局的都放在这

#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>
#import "UserModel.h"
#import "Music.h"
#import "DownLRCManager.h"

@interface UserManager : NSObject

@property (nonatomic,assign)int  timerLength;  //定时关闭
@property (nonatomic,assign)BOOL isLoadMusic; //设置里判断wife自动下载

//********************播放器******************
@property (nonatomic,strong)AVPlayer *mainPlayer; //后台player
@property (nonatomic,assign)AudioPLayerType audioPlayerType;  //音频、亲子秀、主播
@property (nonatomic,assign)CGPoint mainPoint;  //音乐播放器滚动偏移量
@property (nonatomic,assign)BOOL   isBackPlay; //是否在后台播放
@property (nonatomic,assign)BOOL   isPlaying; //是否正在播放
@property (nonatomic,assign)NSUInteger selectMusicIndex;  //当前第几首歌曲
@property (nonatomic,strong)NSMutableArray     *musicArr; //歌曲列表数组
@property (nonatomic,assign)MusicPLayType      musicPlayType;//歌曲列表类型
@property (nonatomic,strong)NSString           *isLastID;  //区分是否为同一个音频ID，方便切换或者直接读取
//**************************************
@property (nonatomic,strong)NSString           *zhubo_SelectIndex;//主播-主页选中的第几个主播 ,默认为0
@property (nonatomic,assign)BOOL   isOnlinePlayer; //是否为在线电台，区分音频和在线电台

@property (nonatomic,strong)UserModel  *userModel;  //登录个人信息

@property (nonatomic,strong)NSMutableArray  *downedMusicArr; //已缓存在本地的音频文件
@property (nonatomic,strong)NSMutableArray  *tempMusicArr; //临时保存本地的音频文件是否已下载

@property (nonatomic,strong)NSMutableArray  *collectionMusicArr; //个人收藏歌曲列表
@property (nonatomic,strong)NSMutableArray  *collectionAlbumArr; //个人收藏专辑列表
@property (nonatomic,strong)NSMutableArray  *collectionShowArr; //个人收藏亲子秀列表
@property (nonatomic,strong)NSMutableArray  *collectionMusicTypeArr; //个人收藏歌曲-儿歌、国学、故事、英文、亲子秀 5个数组 已弃用

@property (nonatomic,strong)NSMutableArray  *praiseListArr; //个人点赞列表

@property (nonatomic,strong)NSMutableArray  *qinzixiuArr; //亲子秀数据

@property (nonatomic,strong)NSMutableDictionary *zhuboDic; //主播个人信息数据

@property (nonatomic,strong)NSMutableArray  *spaceFileArr; //空间文件分类

@property (nonatomic,strong)NSMutableArray  *downingMusicCountArr; //正在下载歌曲列表
@property (nonatomic,strong)NSMutableArray  *waitDownMusicCountArr; //等待下载歌曲列表

+ (UserManager *)standerDefult;
//计时器
- (void)setUpTimer;

//缓存
-(float)folderSizeAtPath;
-(void)clearCache;

//音频转化caf转mp3
- (void)transformCAFToMP3WithPath:(NSString *)filePath
                   withNormalName:(NSString *)normal
                     withFileName:(NSString *)fileName
                     WithComplate:(void(^)(void))block
                        withFaild:(void(^)(void))faile;

//下载歌曲
- (void)downLoadMusic:(NSDictionary *)_selectCurrentMusicDic withRequestArr:(NSArray *)fileIDArr;

//页面点击播放按钮，实现非播放器页面播放功能
- (void)playMusicWithMusicArray:(NSArray *)musciArr
               withCurrentIndex:(NSUInteger)selectIndex
              withMusicPlayType:(MusicPLayType)musicPlayType;

//转换成Music类型数组
- (NSMutableArray *)onTurnArrayFormArray:(NSArray *)musicArr;
- (NSMutableArray *)onTurnArrayFormQingZiXiuArray:(NSArray *)musicArr;
- (NSMutableArray *)onTurnArrayFormOnLineArray:(NSArray *)musicArr;
@end
